package com.leen.admin.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;


/**
 * 部门
 *
 * @author xjl
 * @date 2021-05-19
 */

@Getter
@Setter
@Entity
@ToString
@ApiModel(value = "后台用户和角色关联表模型")
@Table(name = "dept")
public class Dept implements Serializable {
    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @ApiModelProperty(value = "ID",example = "0")
    @Column(name = "id")
    private Integer id;

    /**
     * 部门名称
     */
    @Column(name = "name")
    @ApiModelProperty(value = "部门名称")
    @NotBlank(message = "部门名称不能为空")
    private String name;

    /**
     * 上级部门
     */
    @Column(name = "pid")
    @ApiModelProperty(value = "上级部门",example = "0")
    @NotNull(message = "上级部门不能为空")
    private Integer pid;

    /**
     * 状态
     */
    @Column(name = "enabled")
    @ApiModelProperty(value = "状态",example = "0")
    @NotNull(message = "状态不能为空")
    private Integer enabled;

    /**
     * 创建时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = " 创建时间")
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @JSONField(format = "yyyy-MM-dd HH:mm")
    @ApiModelProperty(value = " 修改时间")
    @Column(name = "update_time")
    private Date updateTime;


    /**
     * 是否删除
     */
    @Column(name = "is_del")
    private Byte del;


    private static final long serialVersionUID = 1L;
}